Fighting, and many other animal behaviours, can often be analysed using game theory. Originally developed for use in economics, game theory provides a framework for understanding why one particular animal might fight and why another might run away.
Essentially, any particular behaviour can be thought of as a simple game. For example, how long should a male dung fly wait for a female to arrive on a cow pat? Any male that waits a little longer than another male will ΓÇÿwinΓÇÖ, as he will be more likely to be there when the female arrives. But sometimes, she will take a long time. The males might die of starvation, and never manage to pass on their genes. So always waiting for a fixed length of time is not a stable strategy because (up to a point) any male that always waits for a little longer will win. It turns out that the evolutionarily stable strategy (ESS) in this situation is to wait for random lengths of time. Then, every individual is equally likely to mate.
In general, an ESS is a strategy that cannot be beaten by individuals playing a slightly different strategy. Often, stable strategies can lead to different individuals doing different things. For example, every dung fly in the population could always wait for a random length of time. Or, every dung fly might always wait for a fixed time. But the distribution of the waiting times of all flies might be random. In this case, a few individuals would always wait for a longish time but most would just wait for a short time.